<?php
class View
{
	private static $data = array();
	
	public static function assign($var, $val)
	{
		self::$data[$var] = $val;
	}
	
	public static function display($tpl)
	{
		@extract(self::$data);
		if (ENV){
			error_reporting(E_ERROR);
		}else{
			error_reporting(E_ALL);
		}
		$tpl = TPL_PATH . $tpl;
		if (!file_exists($tpl)) {
			exit("TPL ERROR:<b>$tpl</b> not exist!");
		}
		include $tpl;
	}
}